import org.rsbot.script.methods.Calculations;
import org.rsbot.script.methods.Objects;
import org.rsbot.script.methods.Walking;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSPlayer;
import org.rsbot.script.wrappers.RSTile;

class VoluntaryThieve$Actions$10 extends VoluntaryThieve.Action
{
  RSObject bankBooth;

  VoluntaryThieve.Action.State perform()
  {
    this.bankBooth = VoluntaryThieve.access$6400(this.this$1.this$0).getNearest(new int[] { 52397 });
    if ((this.bankBooth == null) || (!VoluntaryThieve.access$6500(this.this$1.this$0).tileOnMap(this.bankBooth.getLocation()))) {
      return VoluntaryThieve.Action.State.FAILED;
    }
    return VoluntaryThieve.access$6600(this.this$1.this$0).walkTileMM(this.bankBooth.getLocation(), 2, 2) ? VoluntaryThieve.Action.State.COMPLETED : VoluntaryThieve.Action.State.PROGRESSING;
  }

  VoluntaryThieve.Action.State confirm()
  {
    RSTile localRSTile = VoluntaryThieve.access$6700(this.this$1.this$0).getDestination();
    if (localRSTile != null) {
      if (VoluntaryThieve.access$6800(this.this$1.this$0).distanceBetween(localRSTile, this.bankBooth.getLocation()) > 3.0D) {
        return VoluntaryThieve.Action.State.FAILED;
      }
      if (this.this$1.this$0.getMyPlayer().isMoving()) {
        return VoluntaryThieve.Action.State.COMPLETED;
      }
    }
    return VoluntaryThieve.Action.State.PROGRESSING;
  }

  VoluntaryThieve.Action.State finish()
  {
    if (VoluntaryThieve.access$6900(this.this$1.this$0).distanceTo(this.bankBooth) > this.this$1.this$0.random(4, 7))
      VoluntaryThieve.Antibans.access$4300(VoluntaryThieve.access$4200(this.this$1.this$0), new int[] { 0 }, this.this$1.this$0.random(17, 23));
    return this.bankBooth.isOnScreen() ? VoluntaryThieve.Action.State.COMPLETED : VoluntaryThieve.Action.State.PROGRESSING;
  }
}